package org.hbkj.springbootmybatis.dao;

import org.apache.ibatis.annotations.Mapper;
import org.hbkj.springbootmybatis.entity.ShoppingCartDo;
import java.util.List;

@Mapper
public interface ShoppingCartDao {
    // 根据 userid 查询购物车列表
    List<ShoppingCartDo> selectByUserId(Integer userid);

    // 更新购物车数量和总价
    int updateQuantityAndTotal(ShoppingCartDo cartDo);

    // 新增购物车记录
    int insert(ShoppingCartDo cartDo);

    // 删除购物车记录
    int deleteByCartIdAndUserId(Integer cartid, Integer userid);
}